package com.yanxibao.bean;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

/**
 * 评论表
 * @TableName yxb_comments
 */
@TableName(value ="yxb_comments")
@Data
public class Comments implements Serializable,Cloneable {

    @Serial
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
    /**
     * 主键id
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 推文ID
     */
    private Integer blogId;

    /**
     * 内容
     */
    private String contents;

    /**
     * 被赞数
     */
    private Integer likes;

    /**
     * 评论时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm;ss", timezone = "GTM+8")
    private LocalDateTime publishTime;

    private String userId;

    /**
     * 是否被赞
     */
    @TableField(exist = false)
    private Boolean isLikes;


}